package com.example.util;

import cn.hutool.core.bean.BeanUtil;
import com.example.sys.entity.AsyncRoutes;
import com.example.sys.entity.Dept;
import com.example.sys.entity.Menu;
import com.example.sys.vo.AsyncRoutesVo;
import com.example.sys.vo.DeptVo;
import com.example.sys.vo.MenuVo;

public class VoUtil {

    public static DeptVo deptToDeptVo(Dept p){

        DeptVo deptVo = new DeptVo();
        BeanUtil.copyProperties(p, deptVo);
        deptVo.setId(deptVo.getDeptId());
        deptVo.setLabel(deptVo.getDeptName());
        return deptVo;
    }

    public static MenuVo menuToMenuVo(Menu p){

        MenuVo menuVo = new MenuVo();
        BeanUtil.copyProperties(p, menuVo);
        return menuVo;
    }

    public static AsyncRoutesVo asyncRoutesToAsyncRoutesVo(AsyncRoutes p){

        AsyncRoutesVo asyncRoutesVo = new AsyncRoutesVo();
        BeanUtil.copyProperties(p, asyncRoutesVo);
        return asyncRoutesVo;
    }
}